package cn.iocoder.mall.resource.dao;

import cn.iocoder.mall.resource.dataobject.ShopType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description: 商品类目/商户类型
 * @Author: jeecg-boot
 * @Date:   2019-10-30
 * @Version: V1.0
 */
@Mapper
public interface ShopTypeMapper extends BaseMapper<ShopType> {
    IPage<ShopType> getNodeTree(Page page, @Param("sqlWhere") String sqlWhere);

    List<ShopType> getShopTypeList(@Param("type") Integer type);

    @Select("select * from shop_type where name like '%#{name}%' ")
    List<ShopType> getShopTypeListByName(@Param("name") String name);

    @Select("select * from shop_type where type = #{type} ")
    List<ShopType> getShopTypeListOfNoTree(@Param("type") Integer type);
}
